//拷贝字符串
#include "stdio.h"

int main(int argc, char const *argv[]) {
  void copyString(char *to, char *from);
  char string1[] = "A string to be copied.";
  char string2[50];

  copyString(string2,string1);
  printf("string2 = %s\n", string2);

  copyString(string2,"So is this.");
  printf("string2 = %s\n", string2);

  return 0;
}

void copyString(char *to, char *from){
  for (; *from != '\0'; ++from,++to) {
    *to = *from;
  }
  *to = '\0';
}
